import request from '@/utils/request'

export function getUserCenter(header?: any) {
    return request.get({ url: '/user/center', header }, { ignoreCancel: true })
}

// 个人信息
export function getUserInfo() {
    return request.get({ url: '/user/info' }, { isAuth: true })
}

// 个人编辑
export function userEdit(data: any) {
    return request.post({ url: '/user/setInfo', data }, { isAuth: true })
}

// 绑定手机
export function userBindMobile(data: any, header?: any) {
    return request.post({ url: '/user/bindMobile', data, header }, { isAuth: true })
}

// 微信电话
export function userMnpMobile(data: any) {
    return request.post({ url: '/user/getMobileByMnp', data }, { isAuth: true })
}

// 更改手机号
export function userChangePwd(data: any) {
    return request.post({ url: '/user/changePassword', data }, { isAuth: true })
}

//实名认证
export function setCard(data: Record<string, any>) {
    return request.post({ url: '/index/set_card', data })
}

//忘记密码
export function forgotPassword(data: Record<string, any>) {
    return request.post({ url: '/user/resetPassword', data })
}

//余额明细
export function accountLog(data: any) {
    return request.get({ url: '/account_log/lists', data })
}

// 可购买优惠券
export function getCoupon() {
    return request.get({ url: '/user/youhuijuan' }, { isAuth: true })
}

//下单
export function yhjSub(data: Record<string, any>) {
    return request.post({ url: '/user/yhj_sub', data })
}

//支付
export function prepay(data: Record<string, any>) {
    return request.post({ url: '/pay/prepay', data })
}

// 我的优惠券（用户）
export function getMyCoupon() {
    return request.get({ url: '/user/myyhj' }, { isAuth: true })
}

// 优惠卷详细
export function geCouponMsg(data: Record<string, any>) {
    return request.post({ url: '/user/yhjinfo', data })
}

// 核销优惠券
export function geCouponHexiao(data: Record<string, any>) {
    return request.post({ url: '/index/yhj_hexiao', data })
}

// 用户使用记录
export function getShiyonglist() {
    return request.get({ url: '/user/hexiaolist' }, { isAuth: true })
}

// 我商家核销记录
export function getHexiaolist() {
    return request.get({ url: '/user/sh_hexiaolist' }, { isAuth: true })
}

// 是否领取停车券
export function geTcj(data: Record<string, any>) {
    return request.post({ url: '/user/tcj', data })
}

// 领取停车券
export function geLqtcj(data: Record<string, any>) {
    return request.post({ url: '/user/lqtcj', data })
}

// 领取停车券列表
export function geTcjlist(data: Record<string, any>) {
    return request.post({ url: '/user/tcjlist', data })
}